CET updates from Olaf.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 29 Aug 2005 22:59:42 +0000 (22:59 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 29 Aug 2005 22:59:42 +0000 (22:59 +0000)
gpsbabel/gdb.c
gpsbabel/reference/cet/cet-sample.gpx
gpsbabel/reference/gdb-sample.gpx

index a6f98af2b9257138107cf659036afea1df1f005e..ad32de68b2f208a6a08e8827c1e3abd5b4150926 100644 (file)
@@ -207,65 +207,8 @@ gdb_detect_rtept_class(const waypoint *wpt)
 }
 
 
-#ifndef UTF8_SUPPORT
-static char *gdb_garmin_to_utf8(const char *s)
-{
-       int len;
-       char *res;
-       unsigned char c;
-       char *src, *dst;
-
-       if (s == NULL) return NULL;
-
-       len = 0;
-       src = (char *)s;
-       while ('\0' != (c = *src++))
-       {
-           len++;
-           if (c & 0x80) len++;
-           if (c == 0x80) len++;
-       }
-
-       src = (char *)s;
-       dst = res = (void *) xmalloc(len + 1);
-       while ('\0' != (c = *src++))
-       {
-           if (c == 0x80)
-           {
-               *dst++ = 0xe2;
-               *dst++ = 0x82;
-               *dst++ = 0xac;
-           }
-           else if (c & 0x80)
-           {
-               *dst++ = (0xc0 | (c >> 6));
-               *dst++ = (c & 0xbf);
-           }
-           else
-           {
-               *dst++ = c;
-           }
-       }
-       *dst = '\0';
-       return res;
-}
-#endif
-
 /* %%% local functions (read support) %%% */
 
-static char *
-gdb_convert_name_buff(char *buff, size_t buffsize)
-{
-#ifdef UTF8_SUPPORT
-       char *tmp = str_garmin_to_utf8(buff);
-#else
-       char *tmp = gdb_garmin_to_utf8(buff);
-#endif 
-       strncpy(buff, tmp, buffsize);
-       xfree(tmp);
-       return buff;
-}
-
 #ifdef GDB_DEBUG
 static void
 gdb_print_buff(const char *buff, int count, const char *comment)
@@ -540,7 +483,6 @@ gdb_read_wpt(const size_t fileofs, int *wptclass)
 /********************************************************************************************************/
 
        gdb_is_valid(gdb_fread_str(xname, sizeof(xname)) > 0, prefix, "new waypoint");
-       gdb_convert_name_buff(xname, sizeof(xname));
 
        gdb_fread_le(&xclass, sizeof(xclass), 32, prefix, "class");
        gdb_fread_str(buff, sizeof(buff));                              /* country */
@@ -553,7 +495,6 @@ gdb_read_wpt(const size_t fileofs, int *wptclass)
            gdb_fread_le(&xalt, sizeof(xalt), 64, prefix, "altitude");
        
        gdb_fread_str(xnotes, sizeof(xnotes));                          /* notes */
-       gdb_convert_name_buff(xnotes, sizeof(xnotes));
        
        if (gdb_fread_flag(1))                                          /* proximity flag */
            gdb_fread_le(&xproximity, sizeof(xproximity), 64, prefix, "proximity");
@@ -575,12 +516,17 @@ gdb_read_wpt(const size_t fileofs, int *wptclass)
        gdb_fread(buff, 1);
 
        if (gdb_fread_flag(0))
-           gdb_fread(buff, 4);
-       else
            gdb_fread(buff, 3);
+       else
+           gdb_fread(buff, 2);
+       
+       do                                                              /* undocumented & unused string */
+       {
+           gdb_fread(buff, 1);
+       }
+       while (buff[0] != 0);
 
-       gdb_fread_str(xurl, sizeof(xurl));
-       gdb_convert_name_buff(xurl, sizeof(xurl));
+       gdb_fread_str(xurl, sizeof(xurl));                              /* URL */
        
        xcat = gdb_fread_le(&xcat, sizeof(xcat), 16, prefix, "category");
        
@@ -667,7 +613,6 @@ gdb_read_route(void)
        const char *prefix3 = "rte_read_final";
        
        gdb_is_valid(gdb_fread_str(xname, sizeof(xname)) > 0, prefix, "Route has no name");
-       gdb_convert_name_buff(xname, sizeof(xname));
        
        gdb_fread_le(&auto_name, sizeof(auto_name), 8, prefix, "auto name");
        if (gdb_fread_flag(0))                                  /* max. data flag */
@@ -703,7 +648,6 @@ gdb_read_route(void)
        while (count--)
        {
            gdb_fread_str(xwptname, sizeof(xwptname));                  /* waypoint name */
-           gdb_convert_name_buff(xwptname, sizeof(xwptname));
        
            gdb_fread_le(&xclass, sizeof(xclass), 32, prefix1, "class");        /* class */
            gdb_fread_str(buff, sizeof(buff));                                  /* country */
@@ -814,7 +758,6 @@ gdb_read_track(const size_t max_file_pos)
        const char *prefix = "trk_read_loop";
        
        gdb_fread_str(xname, sizeof(xname));
-       gdb_convert_name_buff(xname, sizeof(xname));
        
        gdb_fread_le(&xdisplay, sizeof(xdisplay), 8, prefix0, "display");
        gdb_fread_le(&xcolour, sizeof(xcolour), 32, prefix0, "colour");
index 9122e59becec20dd730bab4c128915a91c5117c6..f51bfd4514d7572a26e37ea06d46498cb3cd8f55 100644 (file)
@@ -39,7 +39,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
 <time>2005-07-14T10:43:00Z</time>
   <name>CS</name>
   <cmt>Ovládací, Prohlížení lokální síte</cmt>
-  <desc> Czechia (cz) </desc>
+  <desc>Ovládací, Prohlížení lokální síte</desc>
   <sym>Waypoint</sym>
 </wpt>
 <wpt lat="56.011734009" lon="9.847869873">
@@ -53,14 +53,14 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
 <time>2005-07-14T09:41:43Z</time>
   <name>DE</name>
   <cmt>Himmelmühle, ä,ö,ü,Ä,Ö,Ü,ß</cmt>
-  <desc>ermany (de)</desc>
+  <desc>Himmelmühle, ä,ö,ü,Ä,Ö,Ü,ß</desc>
   <sym>Waypoint</sym>
 </wpt>
 <wpt lat="50.495280828" lon="13.027644670">
 <time>2005-07-14T13:20:14Z</time>
   <name>EO</name>
   <cmt>Trasercado de la loka ret</cmt>
-  <desc>?? (oe)</desc>
+  <desc>Trasercado de la loka ret</desc>
   <sym>Waypoint</sym>
 </wpt>
 <wpt lat="37.007446289" lon="-6.558837891">
@@ -81,7 +81,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
 <time>2005-07-14T09:28:22Z</time>
   <name>HR</name>
   <cmt>Pregledavanje lokalne mreže</cmt>
-  <desc>roatia (local name: Hrvatska) (hr)</desc>
+  <desc>Pregledavanje lokalne mreže</desc>
   <sym>Waypoint</sym>
 </wpt>
 <wpt lat="46.491394043" lon="18.424072266">
@@ -102,7 +102,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
 <time>2005-07-14T09:34:53Z</time>
   <name>SK</name>
   <cmt>Ovládacie centrum</cmt>
-  <desc>ei D09544,Neuhausen/Cämmerswalde</desc>
+  <desc>Ovládacie centrum</desc>
   <sym>Waypoint</sym>
 </wpt>
 <wpt lat="50.497970581" lon="13.027725220">
index c55109130b011d3922a666cddc88442480904d8b..90a54c69ea53cf362f2029007d3a241753ae7694 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <gpx
  version="1.0"
 creator="GPSBabel - http://www.gpsbabel.org"
@@ -66,9 +66,9 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
 </wpt>
 <wpt lat="51.314520836" lon="12.409143448">
 <time>2005-06-24T00:36:57Z</time>
-  <name>V&#xf6;lkerschlachtdenkmal</name>
-  <cmt>P+R Am V&#xf6;lkerschlachtdenkmal</cmt>
-  <desc>P+R Am V&#xf6;lkerschlachtdenkmal</desc>
+  <name>Völkerschlachtdenkmal</name>
+  <cmt>P+R Am Völkerschlachtdenkmal</cmt>
+  <desc>P+R Am Völkerschlachtdenkmal</desc>
   <url>http://Voelkerschlachtdenkmal</url>
   <sym>Waypoint</sym>
 </wpt>
@@ -85,7 +85,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
   <rtept lat="50.492606163" lon="12.105431557">
 <time>2005-04-26T14:27:21Z</time>
     <name>416</name>
-  <url>Fahren Sie auf die Luis-Ferdinand-Sch&#xf6;nherr-Strasse nach Norden</url>
+  <url>Fahren Sie auf die Luis-Ferdinand-Schönherr-Strasse nach Norden</url>
     <sym>Waypoint</sym>
   </rtept>
   <rtept lat="50.492606163" lon="12.105431557">
@@ -114,7 +114,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
   <rtept lat="50.493836962" lon="12.106101271">
 <time>2005-04-26T14:27:21Z</time>
     <name>420</name>
-  <url>Fahren Sie auf die Liebknechtstrasse nach S&#xfc;dosten</url>
+  <url>Fahren Sie auf die Liebknechtstrasse nach Südosten</url>
     <sym>Waypoint</sym>
   </rtept>
   <rtept lat="50.493378639" lon="12.107105255">
@@ -250,7 +250,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
   <rtept lat="50.534491539" lon="12.104487419">
 <time>2005-04-26T14:27:21Z</time>
     <name>444</name>
-  <url>Biegen Sie links ab auf die An Der Sch&#xf6;psdrehe</url>
+  <url>Biegen Sie links ab auf die An Der Schöpsdrehe</url>
     <sym>Waypoint</sym>
   </rtept>
   <rtept lat="50.534920692" lon="12.103457451">
@@ -443,7 +443,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
   <rtept lat="50.654762965" lon="12.204956934">
 <time>2005-04-26T14:27:22Z</time>
     <name>478</name>
-  <url>Fahren Sie auf die August-Bebel-Strasse nach S&#xfc;dosten</url>
+  <url>Fahren Sie auf die August-Bebel-Strasse nach Südosten</url>
     <sym>Waypoint</sym>
   </rtept>
   <rtept lat="50.653924942" lon="12.207655907">
@@ -599,7 +599,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
   <rtept lat="50.812325478" lon="12.387084961">
 <time>2005-04-26T14:27:22Z</time>
     <name>508</name>
-  <url>Biegen Sie rechts ab auf die Carth&#xe4;userstrasse</url>
+  <url>Biegen Sie rechts ab auf die Carthäuserstrasse</url>
     <sym>Waypoint</sym>
   </rtept>
   <rtept lat="50.812454224" lon="12.386956215">
@@ -712,7 +712,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
   <rtept lat="50.858330727" lon="12.424507141">
 <time>2005-04-26T14:27:22Z</time>
     <name>528</name>
-  <url>Biegen Sie rechts ab auf die G&#xf6;ssnitzer Strasse</url>
+  <url>Biegen Sie rechts ab auf die Gössnitzer Strasse</url>
     <sym>Waypoint</sym>
   </rtept>
   <rtept lat="50.860562325" lon="12.427039146">
@@ -858,13 +858,13 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
   <rtept lat="50.949354172" lon="12.405452728">
 <time>2005-04-26T14:27:23Z</time>
     <name>555</name>
-  <url>Biegen Sie rechts ab auf die Schm&#xf6;llner Strasse</url>
+  <url>Biegen Sie rechts ab auf die Schmöllner Strasse</url>
     <sym>Waypoint</sym>
   </rtept>
   <rtept lat="50.956048965" lon="12.410302162">
 <time>2005-04-26T14:27:23Z</time>
     <name>556</name>
-  <url>Halten Sie sich rechts in Richtung Stra&#xdf;e</url>
+  <url>Halten Sie sich rechts in Richtung Straße</url>
     <sym>Waypoint</sym>
   </rtept>
   <rtept lat="50.964955157" lon="12.435919270">
@@ -883,7 +883,7 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
   <rtept lat="50.964955157" lon="12.435919270">
 <time>2005-04-26T14:27:23Z</time>
     <name>558</name>
-  <url>Fahren Sie auf die Stra&#xdf;e nach Nordosten</url>
+  <url>Fahren Sie auf die Straße nach Nordosten</url>
     <sym>Waypoint</sym>
   </rtept>
   <rtept lat="50.999994278" lon="12.470340729">
@@ -1129,9 +1129,9 @@ xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/
   </rtept>
   <rtept lat="51.314520836" lon="12.409143448">
 <time>2005-06-24T00:36:57Z</time>
-    <name>V&#xf6;lkerschlachtdenkmal</name>
-    <cmt>P+R Am V&#xf6;lkerschlachtdenkmal</cmt>
-    <desc>P+R Am V&#xf6;lkerschlachtdenkmal</desc>
+    <name>Völkerschlachtdenkmal</name>
+    <cmt>P+R Am Völkerschlachtdenkmal</cmt>
+    <desc>P+R Am Völkerschlachtdenkmal</desc>
   <url>http://Voelkerschlachtdenkmal</url>
     <sym>Waypoint</sym>
   </rtept>